package com.zhanglingfei.yuekaoshop.entity;

import lombok.Data;

import java.io.Serializable;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author Shichao.Lu
 * 规格参数组下的参数名
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "tb_spec_param")
@DynamicInsert
@DynamicUpdate
public class SpecParam implements Serializable {

	/**
	 * 主键
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id")
	private Long id;

	/**
	 * 商品分类id
	 */
	@Column(name = "cid")
	private Long cid;

	/**
	 * null
	 */
	@Column(name = "group_id")
	private Long groupId;

	/**
	 * 参数名
	 */
	@Column(name = "name")
	private String name;

	/**
	 * 是否是数字类型参数，true或false
	 */
	@Column(name = "numeric")
	private Boolean numeric;

	/**
	 * 数字类型参数的单位，非数字类型可以为空
	 */
	@Column(name = "unit")
	private String unit;

	/**
	 * 是否是sku通用属性，true或false
	 */
	@Column(name = "generic")
	private Boolean generic;

	/**
	 * 是否用于搜索过滤，true或false
	 */
	@Column(name = "searching")
	private Boolean searching;

	/**
	 * 数值类型参数，如果需要搜索，则添加分段间隔值，如CPU频率间隔：0.5-1.0
	 */
	@Column(name = "segments")
	private String segments;
}
